num = 100


def fn1():
    num = 10
    print(num)


fn1()
print(num)

# global 关键字
num = 100


def fn():
    global num  # 下面操作的num变量是一个全局变量
    num = 1000
    print(num)


fn()

print(num)
